﻿Imports System.Data.SqlClient

Public Class WorkshopRoster
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'SQL to load all 
        Dim con As New SqlConnection
        Dim cmd As New SqlCommand

        'change this to get our Oracle
        con.ConnectionString = "Data Source=localhost;Initial Catalog=invsystem;Persist Security  Info=True;User ID=s12setwin;Password=JDLOAF"

        'open a connection to the db
        con.Open()

        'send command to the database
        cmd.Connection = con

        'set the SQL as the command to get workshop details
        cmd.CommandText = "SELECT * from workshop" 'getes workshop details 

        'read the info returned from the sql
        Dim lrd As SqlDataReader = cmd.ExecuteReader()
        While lrd.Read()
        End While
        'populate the workshop details here
        '==============================================================


        Dim con1 As New SqlConnection
        Dim cmd1 As New SqlCommand

        'change this to get our Oracle
        con1.ConnectionString = "Data Source=localhost;Initial Catalog=invsystem;Persist Security  Info=True;User ID=s12setwin;Password=JDLOAF"

        'open a connection to the db
        con1.Open()

        'send command to the database
        cmd1.Connection = con1

        'set the SQL to get ppl enrolled in wkshop
        cmd1.CommandText = "SELECT * from employee where workshopEnrolledin = x " 'getes peopel in workshop
        'read the info returned from the sql

        Dim lrd1 As SqlDataReader = cmd1.ExecuteReader()
        While lrd1.Read()
        End While



    End Sub

    Protected Sub backButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles backButton.Click
        Response.Redirect("ViewRosters.aspx")
    End Sub

    Protected Sub viewEmployeeInfo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles viewEmployeeInfo.Click

        'get employee id from the database to display all information for the selected employee (not the instructor)

        Response.Redirect("ViewEProfile.aspx")
    End Sub
End Class